<?php if(!IS_AJAX){  ?>
<include file="Public:header" />
<section class="panel" style="width:650px">
    <div class="panel-body" style="padding-left:0;padding-right:0">
        <div class="col-lg-12 col-sm-12 col-md-12">
            <div class="btn-group pull-left">
                <select class="form-control" name="integraltype">
                    <volist name="integraltype" id="it">
                        <option value="{$it['id']}">{$it['remark']}</option>
                    </volist>
                </select>
                <select class="form-control pull-right io" name="io" style="display:inline; margin-right:5px; width:auto;">
                    <option value="1">奖分</option>
                    <option value="-1">扣分</option>
                </select>
            </div>
            <div class="btn-group pull-right">
                <button class="btn btn-default"  value="week">本周</button>
                <button class="btn btn-default"  value="month">本月</button>
                <button class="btn btn-default"  value="year">本年</button>
            </div>
            <form action="{:U('Unit/chart')}" id="timeajaxform" method="post">
                <!--pid优先,mid其次,两者皆空则找第一个部门id-->
                <input type="hidden" name="pid" value="">
                <input type="hidden" name="mid" value="">
                <input type="hidden" name="time" value="">
                <input type="hidden" name="io" value="">
                <input type="hidden" name="integraltype" value="">
            </form>
        </div>
        <div class="clearfix"></div>
        <div style="width:650px" id="timeajax">
            <!--此处post引入图表-->
            <?php } ?>
            <?php if(!IS_AJAX){ ?>
        </div>
    </div>
</section>
<include file="Public:script" />
<script src="__PUBLIC__/Intesys/AdminX/js/morris-chart/morris.js"></script>
<script src="__PUBLIC__/Intesys/AdminX/js/morris-chart/raphael-min.js"></script>
<script src="__PUBLIC__/Intesys/AdminX/js/chart-js/Chart.js"></script>
<script>
    $('#timeajax').ajaxlist();
    $.post("{:U('Unit/chart')}",function(data){
        $('#timeajax').html(data.tbody);
    },'json');
    $('.btn').each(function(){
        $(this).click(function(){
            $('#timeajaxform input[name="time"]').val($(this).attr('value'));
            $('#timeajaxform').submit();
        });
    });
    $('.io').change(function(){
        $('#timeajaxform input[name="io"]').val($(this).val());
        $('#timeajaxform').submit();
    });
    $('select[name="integraltype"]').change(function(){
        $('#timeajaxform input[name="integraltype"]').val($(this).val());
        $('#timeajaxform').submit();
    });
</script>
</body></html>
<?php } ?>